<div class="panel panel-default" ng-controller="UserCtrl">
	<div class="panel-heading">关注列表</div>
	<table class="table table-striped table-hover">
		<colgroup>
			<col width="20%">
			<col width="10%">
			<col width="15%">
			<col width="15%">
			<col width="10%">
			<col width="30%">
		</colgroup>
		<thead>
			<tr>
				<th>昵称</th>
				<th>性别</th>
				<th>省/直辖市</th>
				<th>市/区</th>
				<th class="center-wx">状态</th>
				<th>微信号</th>
			</tr>
		</thead>
		<tbody>
			<tr class="fade-animate" ng-repeat="user in users" ng-if="!empty(users)">
				<td>{{user.prop.nickname}}</td>
				<td>{{user.prop.sexName}}</td>
				<td>{{user.prop.province}}</td>
				<td>{{user.prop.city}}</td>
				<td class="center-wx color-red" ng-switch="user.prop.subscribe">
					<i class="fa fa-heart" ng-switch-when="1"></i>
					<i class="fa fa-heart-o" ng-switch-when="0"></i>
				</td>
				<td>{{user.openId}}</td>
			</tr>
			<tr class="fade-animate" ng-if="empty(users)">
				<td colspan="6" class="center-wx">&{'app.common.empty'}</td>
			</tr>
		</tbody>
	</table>
</div>
<pagination></pagination>

<script type="text/javascript">
'use strict'
var UserCtrl = ['$scope', '$http', function($scope, $http) {
	// 定义方法
	angular.extend($scope, {
		search: function(page, size) {
			$http({
				method: 'get', 
				url: '@{Users.search}', 
				data: $.param({page: page}), 
				headers: {'Content-Type': 'application/x-www-form-urlencoded'}
			}).success(function(data) {
				$scope.page(data, 'users');
			});
		}
	});
	
	// 初始化
	$scope.search(1);
}];
</script>
